DEFINE VARIABLE designgrp LIKE pt_dsgn_grp .
DEFINE VARIABLE isTakeover AS CHARACTER LABEL "TakeOver".
DEFINE VARIABLE part LIKE pt_part .
DEFINE VARIABLE ret AS CHARACTER LABEL "result" .
    
INPUT FROM VALUE(SEARCH("g:\pt_design.txt")).
    
OUTPUT TO g:\non-part.txt .

REPEAT ON ERROR UNDO WITH FRAME a STREAM-IO :
 
    IMPORT DELIMITER "," designgrp isTakeover part .
/*
    DISP designgrp isTakeover part .
*/
 
    FIND FIRST pt_mstr EXCLUSIVE-LOCK WHERE pt_part = part NO-ERROR.

    IF AVAILABLE pt_mstr THEN
    DO:
        IF isTakeover = "Y" THEN
            pt__log01 = YES.
        ELSE
            pt__log01 = NO.

        pt_dsgn_grp = designgrp .

        DISP "OK" @ ret designgrp isTakeover part .
    END.
    ELSE
        DISP "??" @ ret designgrp isTakeover part .

END.
 
INPUT CLOSE.
OUTPUT CLOSE.
